-
Notifications
You must be signed in to change notification settings - Fork 132
[Woo POS] Start card reader connection flow and adapt to return result of connection to pos #11616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Woo POS] Start card reader connection flow and adapt to return result of connection to pos #11616
Conversation
…on-flow-and-adapt-to-return-result-of-connection-to-pos
…of risk of breaking the current connection flow
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
I got a crash, which I will was able to reproduce:
I tapped on Connect to card reader, saw this screen, then tapped the back arrow on the dialog: Full stack trace:
|
That's when you started the folow from the POS screen, right? Then this is expected, at least for M1, as we aiming in the "happy path" (it's debatable though if not fully completed onboarding is part of it or not, but in any case it's not part of this PR) More info on that |
Yes, it was in the POS flow. Sounds good! |
Tested and seems to be working correctly: √ √ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code change look good!
FYI I didn't merge yet because the code freeze is still in progress. |
…l-includes-connection-flow-and-adapt-to-return-result-of-connection-to-pos [Woo POS] Start card reader payment flow
…adapt-to-return-result-of-connection-to-pos # Conflicts: # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/root/WooPosActivity.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this, @kidinov!
LGTM. I briefly tested the app against regressions.
I also added a few code improvement ideas for you to consider, let me know what you think.
...n/kotlin/com/woocommerce/android/ui/payments/methodselection/SelectPaymentMethodViewModel.kt
Outdated
Show resolved
Hide resolved
...n/kotlin/com/woocommerce/android/ui/payments/methodselection/SelectPaymentMethodViewModel.kt
Outdated
Show resolved
Hide resolved
...in/kotlin/com/woocommerce/android/ui/payments/methodselection/SelectPaymentMethodFragment.kt
Outdated
Show resolved
Hide resolved
...merce/src/main/kotlin/com/woocommerce/android/ui/woopos/cardreader/WooPosCardReaderFacade.kt
Outdated
Show resolved
Hide resolved
...merce/src/main/kotlin/com/woocommerce/android/ui/woopos/cardreader/WooPosCardReaderFacade.kt
Outdated
Show resolved
Hide resolved
...rce/src/main/kotlin/com/woocommerce/android/ui/woopos/root/navigation/WooPosMainFlowGraph.kt
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/root/navigation/WooPosRootHost.kt
Show resolved
Hide resolved
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/cart/WooPosCartNavigation.kt
Show resolved
Hide resolved
Co-authored-by: Samuel Urbanowicz <samiuelson@gmail.com>
Co-authored-by: Samuel Urbanowicz <samiuelson@gmail.com>
…n-flow-and-adapt-to-return-result-of-connection-to-pos' into 11608-woo-pos-start-cr-connection-flow-and-adapt-to-return-result-of-connection-to-pos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Closes: #11608
Description
The PR adds some changes to reuse the card reader connection flow from the WooPOS screen
It doesn't handle "cancelation" of the connection flow properly, as the flow calls "navigate" on empty stack trace, and for some magical reason, instead of just going back fromWooCardActivity
toWooPosActivity
it just restartsWooCardActivity
. Please share if you have any ideas as to why this happens. As for M1 we aim in a happy flow I created a ticket on that.I started to do "popBackStack" and then it works fine for cancelation of the flow too (looks a bit ugly code-wise though)In the following PR I actually started to return result from the flow back and finish activity
I tried to extract the connection into a separate navigation graph but unfortunately, it requires a lot of changes in the current flows which is very risky at this point
Testing instructions
The most important is to validate that no IPP flow is affected by the changes
To validate that the flow works for POS, click on the "connect" button
Images/gif
05-30--11-14.mp4
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.